//
//  PressCell.m
//  HengHuaSupervision
//
//  Created by XD-XY on 3/25/14.
//  Copyright (c) 2014 XD-XY. All rights reserved.
//

#import "PressCell.h"
#import "XDHeader.h"
#import "XDTools.h"

@implementation PressCell

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        // Initialization code
        [self makeView];
    }
    return self;
}

-(void)makeView
{
    self.firstLabel = [UILabel initLabel:CGRectMake(0, 0, 280/2.0f, mPress_Cell_Height) textFont:mPress_Text_Font textColor:mPress_Title_Color textAlignment:NSTextAlignmentCenter];
    
    self.secondLabel = [UILabel initLabel:CGRectMake(width_x(_firstLabel)+126/2.0f+1, 0, 726/2.0f-126/2.0f-1, mPress_Cell_Height) textFont:mPress_Text_Font textColor:mPress_Content_Color textAlignment:NSTextAlignmentLeft];
    
    self.thirdLabel = [UILabel initLabel:CGRectMake(width_x(_secondLabel)+1, 0, 280/2.0f, mPress_Cell_Height) textFont:mPress_Text_Font textColor:mPress_Title_Color textAlignment:NSTextAlignmentCenter];
    
    self.fourthLabel = [UILabel initLabel:CGRectMake(width_x(_thirdLabel)+126/2.0f+1, 0, 726/2.0f-126/2.0f-1, mPress_Cell_Height) textFont:mPress_Text_Font textColor:mPress_Content_Color textAlignment:NSTextAlignmentLeft];
    
    [self createLineViews];
    
    [self addSubview:_firstLabel];
    [self addSubview:_secondLabel];
    [self addSubview:_thirdLabel];
    [self addSubview:_fourthLabel];
    
    //cell未选中效果
    self.diselectBg = [[UIImageView alloc] init];
    _diselectBg.frame = CGRectMake(0, 0, self.frame.size.width,self.frame.size.height);
    self.backgroundView = _diselectBg;
    
}

-(void)createLineViews
{
    UIImageView * imageView1 = [[UIImageView alloc] initWithImage:mPress_Cutline_Img];
    imageView1.frame = CGRectMake(width_x(_firstLabel), 0, mPress_Cutline_Img.size.width, mPress_Cutline_Img.size.height);
    
    UIImageView * imageView2 = [[UIImageView alloc] initWithImage:mPress_Cutline_Img];
    imageView2.frame = CGRectMake(width_x(_secondLabel), 0, mPress_Cutline_Img.size.width, mPress_Cutline_Img.size.height);
    
    UIImageView * imageView3 = [[UIImageView alloc] initWithImage:mPress_Cutline_Img];
    imageView3.frame = CGRectMake(width_x(_thirdLabel), 0, mPress_Cutline_Img.size.width, mPress_Cutline_Img.size.height);

    [self addSubview:imageView1];
    [self addSubview:imageView2];
    [self addSubview:imageView3];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
